#pragma once

namespace Vortex { namespace Wrapper { namespace Direct3D {

	ref class Direct3DDevice9;

	///<summary>Wrapper of IDirect3DVertexBuffer9 interface</summary>
	public ref class Direct3DPixelShader9 {
		IDirect3DPixelShader9* _handle;

	public:

		///<summary>Direct3DDevice handle</summary>
		property IntPtr Handle { IntPtr get() { return IntPtr(_handle); } }

		property IDirect3DPixelShader9* NativeHandle { IDirect3DPixelShader9* get() { return _handle; } }

		Direct3DPixelShader9(IDirect3DPixelShader9* handle) : _handle(handle) { }

		~Direct3DPixelShader9() { _handle->Release(); }

		HResult GetFunction(void* pBuffer, UINT sizeOfData) {
			return HResult(_handle->GetFunction(pBuffer, &sizeOfData));
		}

		UINT GetFunctionSize() {
			UINT sizeOfData = 0;
			_handle->GetFunction(NULL, &sizeOfData);
			return sizeOfData;
		}

	};
}}}